<!DOCTYPE html>
<html>
  <head>
    <title>首页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
	<meta charset="utf-8">
    <!-- Bootstrap -->
    <link rel="stylesheet" href="__PUBLIC__/addon/malltemplatehome/CSS/bootstrap.min.css">
    <link rel="stylesheet" href="__PUBLIC__/addon/malltemplatehome/CSS/reset.css">
	<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="__PUBLIC__/addon/malltemplatehome/js/jquery-1.11.3.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="__PUBLIC__/addon/malltemplatehome/js/bootstrap.js"></script>
	<!--购物车js代码-->
	<script src="js/simpleCart.js"></script>
	<!--自己的css样式-->
	<link rel="stylesheet" href="__PUBLIC__/addon/malltemplatehome/CSS/store.css">
	
	<script src="http://static.hongdayun.com/public/simplecartjs/3.0.5/simpleCart.min.js"></script>
	
	<script>
		simpleCart.currency({
			code: "RMB" ,
			name: "Chinese Yuan" ,
			symbol: "￥" ,
			delimiter: "" , 
			decimal: "." , 
			after: false ,
			accuracy: 2
		});

		/*设置运费*/
		simpleCart.shipping(function(){
			if(simpleCart.total()>{$express_begin_money}){
				return 0
			}else{
				return {$express_money}
			}
		})
		
	</script>
	
  </head>
  <body>
	<!--nav导航-->
	<div id="list-navb">
		<div class="row">
			<div class="col-xs-3 col-sm-3 navl">
				<div class="img"><a href="__APP__/Home/Mall/Index/Addon/MallTemplateHome.html"><img src="{$logo}"></a></div>
				<div class='navc'>
					<volist name="classify" id="classify">
					<a href="__APP__/Home/Mall/Index/Addon/MallTemplateHome.html?form_id={$classify.id}"><p {$classify.class}>{$classify.name}</p></a>
					</volist>
					<br>
					<br>
				</div>
			</div>
			<div class="col-xs-9 col-sm-9 contentc">
				<div class="row addr">
					<p>
						<a href="__APP__/Home/OAuth/Address/Addon/WeiXin.html">
							<span>配送至：{$address.address}</span>
							<span class="pull-right"><img src="__PUBLIC__/addon/malltemplatehome/images/icon10.jpg"></span>
						</a>
					</p>
					<p>
						<a href="__APP__/Home/Mall/Notice/Addon/MallTemplateHome/id/{$notice.id}.html"><span>公告栏法：{$notice.name}</span></a>
					</p>
				</div>
				<div class="contentb">
					
					<div class="show">
					<volist name="goods" id="goods">
					
						<div class="row pic2">
							<a href="__APP__/Home/Mall/Goods/Addon/MallTemplateHome.html?id={$goods.id}">
							<img src="{$goods.img}" width="100%">
							
							<div class="price">
								<p>{$goods.name}</p>
								<p><!-- <span></span> --><span class="danjia">￥{$goods.money}元/{$goods.unit}</span></p>
							</div>
							</a>
                        <span onclick="add_good_for_cart_{$goods.id}('{$goods.name}添加购物车成功')"  class='price_bottom'>+</span>
								<!-- <div class="hide">
								<span>-</span><input type="text" value="0"><span>+</span>
								</div> -->
							
							
						</div>
						<script>
							function add_good_for_cart_{$goods.id}(msg){
								
								
								simpleCart.add({name:'{$goods.name}', price: {$goods.money},goods_id:'{$goods.id}',img:'{$goods.img}',quantity: 1});
								
								layer.msg(msg);
							}
						</script>
					</volist>
					</div>
						
				</div>
			</div>
			
		</div>
	</div>

	<a href="__APP__/Home/Mall/MyInfo/Addon/MallTemplateHome.html"><img src="__PUBLIC__/addon/malltemplatehome/images/icon55.png" class="person"></a>
	<a href="__APP__/Home/Mall/Cart/Addon/MallTemplateHome.html"><img src="__PUBLIC__/addon/malltemplatehome/images/icon69.png" class="shop">
	<span class="sp simpleCart_quantity">0</span></a>
	<!--footer-->
	<footer id="footer">
		<div class="row">
			<div class="col-xs-8 col-sm-8 footer-left">
				<span class="simpleCart_grandTotal">0.00元</span>
				 <span class=""></span>
				 运费<span class="simpleCart_shipping"></span>
			</div>
			<div class="col-xs-4 col-sm-4 footer-right">
				<a href="__APP__/Home/Mall/Cart/Addon/MallTemplateHome.html"><span class='btn'>去结算</span></a>
			</div>
		</div>
	</footer>
	<!--底部-->
	<!-- <div id="bottom">
		<div class="row">
			<div class="col-xs-4 col-sm-4">
				<img src="__PUBLIC__/addon/malltemplatehome/images/icon8.jpg">
				<p>首页</p>
			</div>
			<div class="col-xs-4 col-sm-4">
				<img src="__PUBLIC__/addon/malltemplatehome/images/icon6.jpg">
				<p>购物车</p>
			</div>
			<div class="col-xs-4 col-sm-4">
				<img src="__PUBLIC__/addon/malltemplatehome/images/icon7.jpg">
				<p>我的</p>
			</div>
		</div>
	</div> -->
	<!-- <script>
		$(function(){
			$('.navc p').bind('click',function(){
				//tab选项卡
				$(this).addClass('hover').siblings().removeClass('hover')
				var num=$(this).index();
				$('.contentc .contentb>div').eq(num).attr('class','show').siblings().attr('class','hide')
			})	
				//价格
				$('.pic2 .price div>p').bind('click',function(){
				
					var oldNum=$(this).next().find('input').val();
					var newNum=Number(oldNum)+1;
					$(this).next().find('input').val(newNum)
					
					$(this).attr('class','hide').siblings().attr('class','show');
					$('.sp').addClass('show')
					var oldText=$('.sp').text()
					console.log(oldText)
					var newText=Number(oldText)+1
					$('.sp').text(newText)
					//价格
					total()
					
					//购物车数量代码
					content();
				})
				$('.pic2 .price div>div span:odd').bind('click',function(){
					var oldNum=$(this).prev().val();
					console.log(oldNum)
					var newNum=Number(oldNum)+1;
					$(this).prev().val(newNum)
					
					var oldText=$('.sp').text()
					var newText=Number(oldText)+1
					$('.sp').text(newText)
					total()
					
					//购物车数量代码
					content();
				})
				$('.pic2 .price div>div span:even').bind('click',function(){
					var oldNum=$(this).next().val()
					var newNum=Number(oldNum)-1;
					if(newNum<1){
						$(this).parent().prev().attr('class','show');
						$(this).parent().attr('class','hide');
						$(this).next().val(0)
						total()
						
						//购物车数量代码
						var aa=new content();
						aa.myItem.decrement(2);
						//aa.myItem.remove();//移除购物车代码
						console.log(aa.myItem.quantity())
					}else{
						$(this).next().val(newNum)
						total()
						//购物车数量代码
						var aa=new content();
						aa.myItem.decrement(2);
						//aa.myItem.remove();//移除购物车代码
						console.log(aa.myItem.quantity())
						
					}
					
					var oldText=$('.sp').text()
					var newText=Number(oldText)-1
					if(newText<1){
						$('.sp').text(0)
						$('.sp').removeClass('show')
					}else{
						$('.sp').text(newText)
					}

				})
				/*合计*/
					function total(){
						var tatal=0;
						$('.price').each(function(){
							//单价
							var aa=$(this).find('.danjia').text()
							var shulang=aa.substr(1)
							//数量
							var bb=$(this).find('input').val()
							tatal+=shulang*Number(bb)
							$(".footer-left span").eq(0).text(tatal.toFixed(2))
						})
					}
					
		})
	</script> -->
	<!-- <script>
		/*购物车*/
		function content(){
			this.myItem=simpleCart.add({name:'蔬菜',price:'36',img:'__PUBLIC__/addon/malltemplatehome/images/icon50.jpg',goods_id:'1',quantity:1,is_buy:1,purchasing:'限购'})
			
		}
		
	</script> -->
	 <script src="http://static.hongdayun.com/public/layer/2.2/layer.js"></script>
	<script src="http://static.hongdayun.com/public/layDate/1.1/laydate.js"></script>
	<script>
					
				//发送当前页面信息
				function notice(msg){  
					layer.msg(msg);
				}	
						
						
		</script>

  </body>
</html>